﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="SampleCustomUpdateDto.aspx.cs" Inherits="OpenWaves.ActivityFeed.Web.Tests.Samples.SampleCustomUpdateDto" %>

<%@ Register TagPrefix="af" Namespace="OpenWaves.ActivityFeed.Web.Controls" Assembly="OpenWaves.ActivityFeed.Web" %>
<%@ Register TagPrefix="c" TagName="SampleDescription" Src="~/Samples/SampleDescription.ascx" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
     <style type="text/css" media="all">
         
         .topics ul {
             float: none;
             margin: 0;
             padding: 0;
             display: inline-block;
             width: auto;
         }
         
         .topics ul li {
             display: inline-block;
         }
     </style>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">
    
<c:SampleDescription runat="server">
    <MessageTemplate>
        <p>This example shows how to use custom UpdateDtos.</p>
        <p>Each 'UpdateDto' object passed to ViewModel contains 'topics' list property.</p>
        <p>Topics are displayed as links.</p>
        <p>IUpdateDtoBuilder is registired in Global.asax</p>
    </MessageTemplate>
</c:SampleDescription> 

<h3>Custom 'UpdateDto' class</h3>
    
    <af:ActivityFeed runat="server" FeedType="Global">
        <UpdateContentTemplates>
            <af:UpdateContentTemplate ContentType="post">
                <div class="content-wrapper postContent">
                    <p><a href="javascript:void(0);" title="palceholder" data-bind="text: publisher().profile.name"></a></p>  
                    <p data-bind="text: content().text"></p>
                    <!-- ko if: update.topics.length > 0 -->
                    <div class="topics">
                       <span>Topics:</span>
                       <ul data-bind="foreach: update.topics">
                           <li ><a data-bind="text: topicName, attr: { href: topicUrl }"></a></li>
                       </ul>
                    </div>
                    <!-- /ko -->
                </div>
            </af:UpdateContentTemplate>
        </UpdateContentTemplates>
    </af:ActivityFeed>
</asp:Content>
